<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css"/>
    <script type="text/javascript" src="__JS__/libs/modernizr.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
   
</head>
<body>
<include file="Common/top" /> 
<div class="container clearfix">
  
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/admin">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">订单管理</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="/jscss/admin/design/index" method="post">
                    <table class="search-tab">
                        <tr>
                            <th width="200">欢迎进入盘古租车后台管理</th>
                            
                            
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
            
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                           
                            
                            <th>ID</th>
                            <th>用户</th>
                            <th>用户手机</th>
                            <th>车型</th>
                            <th>借车点</th>
                            <th>还车点</th>
                           
                            <th>费用</th>
                            <th>订单状态</th>
                            <th>借车时间</th>
                            <th>还车时间</th>
                            <th>操作</th>
                        </tr>
                        {volist name="cates" id="vo"}
                        <tr>
                            
                           
                            <td>{$vo.id}</td>
                            <td>{$vo.username}</td>
                            <td>{$vo.phone}</td>
                            <td>{$vo.brand}</td>
                            <td>{$vo.borrow_city}</td>
                            <td>{$vo.return_city}</td>
                            <td>{$vo.fee}</td>
                            <td>
                                {switch name="$vo.status"}
                                    {case value="1" }已完成{/case}
                                    {case value="0"}租赁中{/case}
                                    {case value="-1"}已取消{/case}
                                {/switch}                     
                            </td>
                            <td>{:date("Y-m-d H:i:s",$vo.borrow_time)}</td>
                            <td>{:date("Y-m-d H:i:s",$vo.return_time)}</td>
                            <td>
                                {switch name="$vo.status" }
                                    {case value="1" }完成 (<a href="javascript:;" class="cancel">取消</a>){/case}
                                    {case value="0"}<a href="javascript:;" class="finish">已还车</a> / <a href="javascript:;" class="cancel">取消</a>{/case}
                                    {case value="-1"}取消{/case}
                                {/switch}                                
                            </td>
                            
                        </tr>
                        {/volist}
                    </table>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
</html>
<script type="text/javascript">
        $('.cancel').click(function() {
            var oid= ($(this).parent().parent().children().first().text());
            $.ajax({
                url: '/admin/cate/cancel',
                type: 'POST',
                dataType: 'json',
                data: {'id': oid},
            })
            .done(function() {
                window.location="/admin/cate/lst";
            })     
        });
        $('.finish').click(function() {
            var oid= ($(this).parent().parent().children().first().text());
            $.ajax({
                url: '/admin/cate/finish',
                type: 'POST',
                dataType: 'json',
                data: {'id': oid},
            })
            .done(function() {
                window.location="/admin/cate/lst";
            })     
        });
</script>
<script type="text/javascript">
    $("#check").click(function(){
        
        if($(this).is("checked","true"))
        {
            $(".check").attr("checked","checked");
        }else
        {
            $(".check").removeAttr("checked","checked");
        }
    });
</script>